package com.yc.cinema.biz;

import com.yc.cinema.bean.User;
import com.yc.cinema.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

// 服务层, 业务层 组件组件
@Service
public class UserBiz {

    // @Autowired
    private UserDao udao;

    public User login(String name, String pwd) {
        System.out.println("================login==============");
        User user = new User();
        user.setUsername(name);
        user.setPassword(pwd);
        return user;
    }

    public void register(User user) throws BizException {
		// 类型转换异常
		Object a = "abc";
		Integer b = (Integer) a;
		System.out.println("正常的注册方法...");
    }

    public UserDao getUdao() {
        return udao;
    }

    public void setUdao(UserDao udao) {
        this.udao = udao;
    }

}
